/**
 * sessionStorage工具
 */
const storageUtils = {
    //存字符串
    saveSessionString(key, value) {
        window.sessionStorage.setItem(key, value);
    },
    //取字符串
    getSessionString(key) {
        return window.sessionStorage.getItem(key);
    },
    //存对象格式化为JOSN
    saveSessionObject(key,value){
        window.sessionStorage.setItem(key,JSON.stringify(value));
    },
    //取出对象
    getSessionObject(key){
        return JSON.parse(window.sessionStorage.getItem(key));
    },
    //删除
    removeData(key){
        window.sessionStorage.removeItem(key);
    }
}

export default storageUtils;